package com.xu.mb3.mbtools;

import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;

/**
 * LogFactory用于获取{@link org.apache.ibatis.logging.Log}对象打印日志
 * mybatis内置了多种日志实现，如：log4j、log4j2、slf4j、commons-logging、JDK logging等, 基于适配器模式适配多种日志框架
 *
 * @author xuguan
 * @since 2024/11/15
 */
public class LogFactorySample {

    /**
     * tryImplementation(LogFactory::useSlf4jLogging);
     * tryImplementation(LogFactory::useCommonsLogging);
     * tryImplementation(LogFactory::useLog4J2Logging);
     * tryImplementation(LogFactory::useLog4JLogging);
     * tryImplementation(LogFactory::useJdkLogging);
     * tryImplementation(LogFactory::useNoLogging);
     */
    private static final Log log = LogFactory.getLog(LogFactorySample.class);

    public static void log() {
        log.debug("hello");
    }

    public static void main(String[] args) {
        log();
    }
}
